/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jjsoft.celularessuc.gco.ui;

import com.jjsoft.celularessuc.gco.mdl.Cliente;
import com.jjsoft.celularessuc.gco.neg.ClienteManager;
import com.jjsoft.celularessuc.gco.rep.ReportePDF;
import com.jjsoft.celularessuc.gco.util.MiModelo;
import java.util.List;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
//import reportes.ReportePDF;

/**
 *
 * @author johnny
 */
public class VMantenimientoCliente extends javax.swing.JFrame {

    /**
     * Creates new form VMantenimientoCliente
     */
    List<Cliente> listaClientes;
    Cliente cli = new Cliente();
    ClienteManager clienteManager = new ClienteManager();
    private static VMantenimientoCliente instancia;
    int i;

    private VMantenimientoCliente() {
        //this.setIconImage(new javax.swing.ImageIcon(getClass().getResource("/img/1362798841_CellPhone.png")).getImage());
        initComponents();
        // controlador.indexarPrimeraVez();    
        i = 0;
        listaClientes = clienteManager.listarClientes(i, 20);
        lblSeMuestra.setText("1 al 20 de " + clienteManager.contarClientes());
        if (clienteManager.contarClientes() > 20) {
            cmdSiguiente.setEnabled(true);
            cmdUltimo.setEnabled(true);
        } else {
            lblSeMuestra.setText("1 al "+clienteManager.contarClientes()+" de " + clienteManager.contarClientes());
            habilitaControles(false);
        }
        cargarDatos();
    }

    public static VMantenimientoCliente getInstance() {
        if (instancia == null) {
            instancia = new VMantenimientoCliente();
        }
        return instancia;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mnuAcciones = new javax.swing.JPopupMenu();
        mnuModificar = new javax.swing.JMenuItem();
        mnuEliminar = new javax.swing.JMenuItem();
        jScrollPane1 = new javax.swing.JScrollPane();
        dtgClientes = new javax.swing.JTable();
        cmdNuevo = new javax.swing.JButton();
        cmdModificar = new javax.swing.JButton();
        cmdEliminar = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        txtMatch = new javax.swing.JTextField();
        cmdBuscar = new javax.swing.JButton();
        cmdTodo = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        cmdExportar = new javax.swing.JButton();
        cmdPrimero = new javax.swing.JButton();
        cmdAnterior = new javax.swing.JButton();
        lblSeMuestra = new javax.swing.JLabel();
        cmdSiguiente = new javax.swing.JButton();
        cmdUltimo = new javax.swing.JButton();

        mnuModificar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/edit21.png"))); // NOI18N
        mnuModificar.setText("Modificar");
        mnuModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuModificarActionPerformed(evt);
            }
        });
        mnuAcciones.add(mnuModificar);

        mnuEliminar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/delete.png"))); // NOI18N
        mnuEliminar.setText("Eliminar");
        mnuEliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuEliminarActionPerformed(evt);
            }
        });
        mnuAcciones.add(mnuEliminar);

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        dtgClientes.setAutoCreateRowSorter(true);
        dtgClientes.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        dtgClientes.setComponentPopupMenu(mnuAcciones);
        dtgClientes.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane1.setViewportView(dtgClientes);

        cmdNuevo.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        cmdNuevo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/new.png"))); // NOI18N
        cmdNuevo.setText("Nuevo");
        cmdNuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmdNuevoActionPerformed(evt);
            }
        });

        cmdModificar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        cmdModificar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/edit.png"))); // NOI18N
        cmdModificar.setText("Modificar");
        cmdModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmdModificarActionPerformed(evt);
            }
        });

        cmdEliminar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        cmdEliminar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/delete.png"))); // NOI18N
        cmdEliminar.setText("Eliminar");
        cmdEliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmdEliminarActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(51, 51, 51));
        jLabel1.setText("Buscar en la tabla:");

        txtMatch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtMatchActionPerformed(evt);
            }
        });
        txtMatch.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                txtMatchPropertyChange(evt);
            }
        });
        txtMatch.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtMatchKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtMatchKeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtMatchKeyTyped(evt);
            }
        });

        cmdBuscar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        cmdBuscar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/buscar.png"))); // NOI18N
        cmdBuscar.setText("Buscar");
        cmdBuscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmdBuscarActionPerformed(evt);
            }
        });

        cmdTodo.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        cmdTodo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/listar.png"))); // NOI18N
        cmdTodo.setText("    Mostrar Todos");
        cmdTodo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmdTodoActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N
        jLabel2.setText("Mantenimiento de Clientes");

        cmdExportar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        cmdExportar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/pdf.png"))); // NOI18N
        cmdExportar.setText("Exportar PDF");
        cmdExportar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmdExportarActionPerformed(evt);
            }
        });

        cmdPrimero.setText("|<");
        cmdPrimero.setEnabled(false);
        cmdPrimero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmdPrimeroActionPerformed(evt);
            }
        });

        cmdAnterior.setText("<");
        cmdAnterior.setEnabled(false);
        cmdAnterior.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmdAnteriorActionPerformed(evt);
            }
        });

        lblSeMuestra.setText("1 al 10 de:");

        cmdSiguiente.setText(">");
        cmdSiguiente.setEnabled(false);
        cmdSiguiente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmdSiguienteActionPerformed(evt);
            }
        });

        cmdUltimo.setText(">|");
        cmdUltimo.setEnabled(false);
        cmdUltimo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmdUltimoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtMatch, javax.swing.GroupLayout.PREFERRED_SIZE, 249, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cmdBuscar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cmdEliminar)
                        .addGap(18, 18, 18)
                        .addComponent(cmdModificar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE)
                        .addComponent(cmdNuevo))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(cmdTodo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(cmdPrimero)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cmdAnterior)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblSeMuestra)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cmdSiguiente)
                        .addGap(6, 6, 6)
                        .addComponent(cmdUltimo)
                        .addGap(18, 18, 18)
                        .addComponent(cmdExportar)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2)
                .addGap(7, 7, 7)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(cmdPrimero)
                        .addComponent(cmdAnterior)
                        .addComponent(cmdSiguiente)
                        .addComponent(cmdUltimo)
                        .addComponent(lblSeMuestra))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(cmdTodo)
                        .addComponent(cmdExportar, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cmdModificar, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel1)
                        .addComponent(txtMatch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(cmdBuscar)
                        .addComponent(cmdNuevo)
                        .addComponent(cmdEliminar, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(22, 22, 22))
        );

        setSize(new java.awt.Dimension(877, 382));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void txtMatchPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_txtMatchPropertyChange
        // TODO add your handling code here:
    }//GEN-LAST:event_txtMatchPropertyChange

    private void txtMatchKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtMatchKeyTyped
        // TODO add your handling code here:
    }//GEN-LAST:event_txtMatchKeyTyped

    private void txtMatchKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtMatchKeyPressed
        // TODO add your handling code here:
        if (evt.getKeyCode() == 10) {
            cmdBuscar.doClick();
        }
    }//GEN-LAST:event_txtMatchKeyPressed

    private void txtMatchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtMatchActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtMatchActionPerformed

    private void txtMatchKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtMatchKeyReleased
        // TODO add your handling code here:
    }//GEN-LAST:event_txtMatchKeyReleased

    private void cmdBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdBuscarActionPerformed
        // TODO add your handling code here:
        if (txtMatch.getText().length() > 0) {
            listaClientes = clienteManager.listarClientes(txtMatch.getText());
            cargarDatos();
        }
    }//GEN-LAST:event_cmdBuscarActionPerformed

    private void cmdNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdNuevoActionPerformed
        // TODO add your handling code here:
        new VNuevoCliente(cmdTodo).setVisible(true);
    }//GEN-LAST:event_cmdNuevoActionPerformed

    private void cmdModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdModificarActionPerformed
        // TODO add your handling code here:
        if (dtgClientes.getSelectedRow() == -1) {
            JOptionPane.showMessageDialog(null, "Primero seleccione un Cliente", "Error", JOptionPane.ERROR_MESSAGE);
        } else {

            new VNuevoCliente(listaClientes.get(dtgClientes.getSelectedRow()), cmdTodo).show();
        }
    }//GEN-LAST:event_cmdModificarActionPerformed

    private void cmdTodoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdTodoActionPerformed
        // TODO add your handling code here:
        listaClientes = clienteManager.listarClientes(i, 20);
        cargarDatos();
    }//GEN-LAST:event_cmdTodoActionPerformed

    private void cmdEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdEliminarActionPerformed
        // TODO add your handling code here:
        if (dtgClientes.getSelectedRow() == -1) {
            JOptionPane.showMessageDialog(null, "Primero seleccione un Cliente", "Error", JOptionPane.ERROR_MESSAGE);
        } else {

            int i = dtgClientes.getSelectedRow();
            if (JOptionPane.showConfirmDialog(rootPane, "Esta seguro de eliminar este cliente?", "Eliminar", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {

                clienteManager.eliminarCliente(listaClientes.get(i));
                listaClientes.remove(i);
                cargarDatos();
            }
        }
    }//GEN-LAST:event_cmdEliminarActionPerformed

    private void cmdExportarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdExportarActionPerformed
        // TODO add your handling code here:
        ReportePDF reporte=new ReportePDF();
        reporte.generarPDF("Clientes.jasper", "ListaClientes.pdf");
    }//GEN-LAST:event_cmdExportarActionPerformed

    private void mnuModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuModificarActionPerformed
        // TODO add your handling code here:
        cmdModificar.doClick();
    }//GEN-LAST:event_mnuModificarActionPerformed

    private void mnuEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuEliminarActionPerformed
        // TODO add your handling code here:
        cmdEliminar.doClick();
    }//GEN-LAST:event_mnuEliminarActionPerformed

    private void cmdPrimeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdPrimeroActionPerformed
        // TODO add your handling code here:
        i = 0;
        cambiaDesplazamientos(false);
        listaClientes = clienteManager.listarClientes(i, 20);
        lblSeMuestra.setText((i + 1) + " al " + (i + 20) + " de " + clienteManager.contarClientes());
        cargarDatos();
    }//GEN-LAST:event_cmdPrimeroActionPerformed

    private void cmdAnteriorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdAnteriorActionPerformed
        // TODO add your handling code here:
        if (i > 0) {
            i = i - 20;
            listaClientes = clienteManager.listarClientes(i, 20);
            lblSeMuestra.setText((i + 1) + " al " + (i + 20) + " de " + clienteManager.contarClientes());
            cargarDatos();
            if (i == 0) {
                cambiaDesplazamientos(false);
            } else if (i < clienteManager.contarClientes()- 20) {
                habilitaControles(true);
            }
        }
    }//GEN-LAST:event_cmdAnteriorActionPerformed

    private void cmdSiguienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdSiguienteActionPerformed
        // TODO add your handling code here:
        if (i < clienteManager.contarClientes()- 20) {
            i = i + 20;
            listaClientes=clienteManager.listarClientes(i,20);
            lblSeMuestra.setText((i+1)+" al "+(i+20)+" de "+clienteManager.contarClientes());
            cargarDatos();
            if (i >= clienteManager.contarClientes()- 20) {
                lblSeMuestra.setText((i + 1) + " al " + clienteManager.contarClientes() + " de " + clienteManager.contarClientes());
                cambiaDesplazamientos(true);
            } else if (i > 0) {
                habilitaControles(true);
            }
        }
    }//GEN-LAST:event_cmdSiguienteActionPerformed

    private void cmdUltimoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdUltimoActionPerformed
        // TODO add your handling code here:
        i = clienteManager.contarClientes()- (clienteManager.contarClientes()% 20);
        listaClientes=clienteManager.listarClientes(i,20);
        lblSeMuestra.setText((i+1)+" al "+clienteManager.contarClientes()+" de "+clienteManager.contarClientes());
        cargarDatos();
        cambiaDesplazamientos(true);
    }//GEN-LAST:event_cmdUltimoActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(VMantenimientoCliente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(VMantenimientoCliente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(VMantenimientoCliente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(VMantenimientoCliente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
            System.out.println("Error setting native LAF: " + e);
        }
        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new VMantenimientoCliente().setVisible(true);
            }
        });
    }

    private void habilitaControles(boolean estado) {
        cmdAnterior.setEnabled(estado);
        cmdPrimero.setEnabled(estado);
        cmdSiguiente.setEnabled(estado);
        cmdUltimo.setEnabled(estado);
    }

    private void cambiaDesplazamientos(boolean estado) {
        cmdAnterior.setEnabled(estado);
        cmdPrimero.setEnabled(estado);
        cmdSiguiente.setEnabled(!estado);
        cmdUltimo.setEnabled(!estado);

    }

    private void cargarDatos() {
        MiModelo modelo = new MiModelo();
        String[] identificadores = new String[]{"Cedula", "Nombres", "Apellidos", "Direccion", "Telefono", "EMail"};
        modelo.setColumnIdentifiers(identificadores);
        dtgClientes.setModel(modelo);
        for (int i = 0; i < listaClientes.size(); i++) {
            String[] cliente = new String[]{listaClientes.get(i).getCedula(), listaClientes.get(i).getNombres(), listaClientes.get(i).getApellidos(), listaClientes.get(i).getDireccion(), listaClientes.get(i).getTelefono(), listaClientes.get(i).getEmail()};
            modelo.addRow(cliente);

        }

//        dtgClientes.getColumn("Cedula").setPreferredWidth(45);
//        dtgClientes.getColumn("Telefono").setPreferredWidth(45);
        //      dtgClientes.getColumn("EMail").setPreferredWidth(150);
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton cmdAnterior;
    private javax.swing.JButton cmdBuscar;
    private javax.swing.JButton cmdEliminar;
    private javax.swing.JButton cmdExportar;
    private javax.swing.JButton cmdModificar;
    private javax.swing.JButton cmdNuevo;
    private javax.swing.JButton cmdPrimero;
    private javax.swing.JButton cmdSiguiente;
    private javax.swing.JButton cmdTodo;
    private javax.swing.JButton cmdUltimo;
    private javax.swing.JTable dtgClientes;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lblSeMuestra;
    private javax.swing.JPopupMenu mnuAcciones;
    private javax.swing.JMenuItem mnuEliminar;
    private javax.swing.JMenuItem mnuModificar;
    private javax.swing.JTextField txtMatch;
    // End of variables declaration//GEN-END:variables
}
